import { stringify } from 'qs'

//首页接口
export const getArea = (params) => {
	return uni.$request(`/area/list?${stringify(params)}`, params, 'GET')
}

//查看挖矿状态
export const checkNovaDay = (params) => {
	console.log(params)
	return uni.$request(`/index/checkNovaDay?${stringify(params)}`, params, 'GET')
}


//开始挖矿activityNovaDay
export const activityNovaDay = (params) => {
	console.log(params)
	return uni.$request(`/index/activityNovaDay?${stringify(params)}`, params, 'POST')
}

export const getEmailCode = (params) => {
	console.log(params)
	return uni.$request(`/index/sendBindEmailCode?${stringify(params)}`, params, 'GET')
}

//修改邮箱获取验证码
export const getEditEmailCode = (params) => {
	console.log(params)
	return uni.$request(`/index/sendUpdateEmailCode?${stringify(params)}`, params, 'GET')
}
//修改支付密码获取验证码
export const getPayPwdEmailCode = (params) => {
	console.log(params)
	return uni.$request(`/index/sendSetPayPassEmailCode?${stringify(params)}`, params, 'GET')
}

//chacktoken /api/v1/index/checkUserEmail
export const checkUser = (params) => {
	return uni.$request(`/index/checkUserEmail?${stringify(params)}`, params, 'GET')
}

//登录 /api/v1/index/into
export const login = (params) => {
	return uni.$request(`/index/into?${stringify(params)}`, params, 'GET')
}

//获取用户信息/api/v1/center/into?telegramId
export const getUserInfo = (params) => {
	return uni.$request(`/center/into?${stringify(params)}`, params, 'GET')
}

//获取recharge /center/recharge
export const getRecharge = (params) => {
	return uni.$request(`/center/recharge?${stringify(params)}`, params, 'GET')
}

//withdraw页面计算使用 /center/withdrawCalculate
export const getWithdrawAmount = (params) => {
	return uni.$request(`/center/withdrawCalculate?${stringify(params)}`, params, 'GET')
}

//withdraw页面提交 /center/withdraw
export const confirmWithdraw = (params) => {
	return uni.$request(`/center/withdraw?${stringify(params)}`, params, 'GET')
}

//mybag /center/myBag
export const getMyBag = (params) => {
	return uni.$request(`/center/myBag?${stringify(params)}`, params, 'GET')
}

export const getAdSellList = (params) => {
	return uni.$request(`/trade/adSellList?${stringify(params)}`, params, 'GET')
}

//getAppCardTypeList /center/getAppCardTypeList
export const getAppCardTypeList = (params) => {
	return uni.$request(`/center/getAppCardTypeList?${stringify(params)}`, params, 'GET')
}

//  /center/pushAdBuy
export const pushAdBuy = (params) => {
	return uni.$request(`/center/pushAdBuy?${stringify(params)}`, params, 'GET')
}

//获取首页信息 /api/v1/index/into
export const getIndexInfo = (params) => {
	return uni.$request(`/index/into?${stringify(params)}`, params, 'GET')
}


//starPond /star/into
export const getStarPond = (params) => {
	return uni.$request(`/star/into?${stringify(params)}`, params, 'GET')
}



//trade 列表 /api/v1/trade/into
export const getTradeList = (params) => {
	return uni.$request(`/trade/into?${stringify(params)}`, params, 'GET')
}

//获取购买详情 /trade/adInfo
export const getBuyInfo = (params) => {
	return uni.$request(`/trade/adInfo?${stringify(params)}`, params, 'GET')
}

//购买 /trade/adBuy
export const adBuy = (params) => {
	return uni.$request(`/trade/adBuy?${stringify(params)}`, params, 'GET')
}

//购买 /trade/adBuy
export const adSell = (params) => {
	return uni.$request(`/trade/adSell?${stringify(params)}`, params, 'GET')
}

// /center/cancelMyAd
export const cancelMyAd = (params) => {
	return uni.$request(`/center/cancelMyAd?${stringify(params)}`, params, 'GET')
}

//combineCards 计算 /center/compoundCalculate
export const compoundCalculate = (params) => {
	return uni.$request(`/center/compoundCalculate?${stringify(params)}`, params, 'GET')
}

//提交合卡 /center/compound
export const compound = (params) => {
	return uni.$request(`/center/compound?${stringify(params)}`, params, 'GET')
}

//设置密码 /index/setPayPass
export const setPayPass = (params) => {
	return uni.$request(`/index/setPayPass?${stringify(params)}`, params, 'GET')
}

//资产详情 /center/myAccountRecord
export const getMyAccountRecord = (params) => {
	return uni.$request(`/center/myAccountRecord?${stringify(params)}`, params, 'GET')
}

//我的团队 /center/myGroup
export const myTeam = (params) => {
	return uni.$request(`/center/myGroup?${stringify(params)}`, params, 'GET')
}

//出售卡片 /center/pushAdSell?telegramId=8003492036&userCardId=10705
export const pushAdSell = (params) => {
	return uni.$request(`/center/pushAdSell?${stringify(params)}`, params, 'GET')
}

//我的发布 /center/myAd
export const getMyAd = (params) => {
	return uni.$request(`/center/myAd?${stringify(params)}`, params, 'GET')
}

//获取我的餐卡 /center/myMealCards
export const getMealCards = (params) => {
	return uni.$request(`/center/myMealCards?${stringify(params)}`, params, 'GET')
}

//修改邮箱 /index/updateEmail
export const updateEmail = (params) => {
	return uni.$request(`/index/updateEmail?${stringify(params)}`, params, 'GET')
}

//获取发布出售广告 /center/pushAdSellSerarchMyBag
export const pushAdSellSerarchMyBag = (params) => {
	return uni.$request(`/center/pushAdSellSerarchMyBag?${stringify(params)}`, params, 'GET')
}

// 上传餐卡  /center/useMealCards
export const useMealCards = (params) => {
	return uni.$request(`/center/useMealCards`, params, 'POST')
}

//销毁card destroyCard
export const destroyCard = (params) => {
	return uni.$request(`/center/destroyCard`, params, 'GET')
}



//swap接口

//get Nova详情信息  /swap/queryNovaInfo
export const getNovaInfo = (params) => {
	return uni.$request(`/swap/queryNovaInfo`, params, 'GET')
}

//获取用户余额 /swap/queryCurrencyBalance
export const getUserBalance = (params) => {
	return uni.$request(`/swap/queryCurrencyBalance?${stringify(params)}`, params, 'GET')
}

//兑换 /swap/transfer
export const transfer = (params) => {
	return uni.$request(`/swap/transfer?${stringify(params)}`, params, 'POST')
}

//查询兑换记录 /api/v1/swap/queryNovaOrder
export const getNovaOrder = (params) => {
	return uni.$request(`/swap/queryMiningOrder?${stringify(params)}`, params, 'GET')
}

//获取质押周期 /api/v1/swap/queryNovaMining
export const getNovaMining = (params) => {
	return uni.$request(`/swap/queryNovaMining?${stringify(params)}`, params, 'GET')
}

//质押 /swap/createMiningOrder
export const createMiningOrder = (params) => {
	return uni.$request(`/swap/createMiningOrder?${stringify(params)}`, params, 'POST')
}

